/* style.css */
:root {
    --panel-bg: rgba(15, 25, 55, 0.88);
    --panel-border: rgba(0, 190, 255, 0.4);
    --panel-shadow: rgba(0, 190, 255, 0.25);
    --text-primary: #d0e0ff;
    --text-secondary: #a0b8e0;
    --text-highlight: #00d0ff;
    --text-title-glow: rgba(150, 180, 255, 0.7);
    --button-bg: rgba(0, 110, 160, 0.6);
    --button-border: rgba(0, 190, 255, 0.5);
    --button-hover-bg: rgba(0, 140, 190, 0.8);
    --button-active-bg: rgba(0, 180, 255, 0.8);
    --button-active-glow: rgba(0, 220, 255, 0.6);
    --button-active-inset: rgba(255,255,255,0.3);
    --button-active-color: #002040;
}

@keyframes subtlePulse {
    0% { box-shadow: 0 0 5px var(--button-active-glow), inset 0 0 3px var(--button-active-inset); }
    50% { box-shadow: 0 0 10px var(--button-active-glow), inset 0 0 5px var(--button-active-inset); }
    100% { box-shadow: 0 0 5px var(--button-active-glow), inset 0 0 3px var(--button-active-inset); }
}

@keyframes panelEnter {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


body {
    margin: 0; padding: 0;
    background-color: #000010;
    background-image: radial-gradient(circle at 30% 30%, rgba(70, 80, 130, 0.6) 0%, rgba(15, 20, 50, 0.8) 40%, #020418 75%),
                      radial-gradient(circle at 70% 70%, rgba(100, 70, 110, 0.5) 0%, rgba(20, 10, 40, 0.7) 35%, #010210 70%);
    background-size: cover; background-position: center center; background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Exo 2', sans-serif;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; overflow: hidden;
}

.simulation-container {
    position: relative; display: flex; flex-direction: column; align-items: center;
    width: 100%; height: 100vh;
}

.main-title {
    margin-top: 15px; margin-bottom: 10px; font-weight: 300; font-size: 2.2em; /* Slightly larger */
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-title-glow), 0 0 15px var(--text-title-glow);
    position: relative; z-index: 10; text-align: center; letter-spacing: 1px;
}

canvas {
    display: block;
    box-shadow: 0 0 30px rgba(0, 150, 220, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.6); /* Enhanced shadow */
    border-radius: 8px; /* Slightly more rounded */
    background-color: rgba(0, 5, 15, 0.4); /* Darker overlay */
    cursor: grab; max-width: 96vw; max-height: 82vh; /* Slightly adjust limits */
}
canvas:active { cursor: grabbing; }

/* Panels Common Styles */
.panel {
    position: absolute;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px; /* More rounded */
    padding: 15px 20px; /* Adjust padding */
    box-shadow: 0 0 20px var(--panel-shadow);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    color: var(--text-primary);
    font-size: 0.95em; /* Slightly larger font */
    z-index: 20;
    animation: panelEnter 0.5s ease-out forwards; /* Entrance animation */
    opacity: 0; /* Start hidden for animation */
}

.controls-panel {
    top: 80px; /* Changed from bottom */
    left: 20px;
    width: auto; max-width: 300px; /* Limit width */
}

.info-panel {
    top: 80px; /* Same level as controls */
    right: 20px;
    width: 300px; /* Slightly wider */
    max-height: calc(100vh - 120px); /* Limit height */
    overflow-y: auto; /* Allow scrolling if content overflows */
}
/* Style scrollbar for info panel (Webkit) */
.info-panel::-webkit-scrollbar { width: 6px; }
.info-panel::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 3px; }
.info-panel::-webkit-scrollbar-thumb { background-color: var(--panel-border); border-radius: 3px; }

h2 {
    margin-top: 0; margin-bottom: 18px; font-weight: 400; font-size: 1.1em; /* Slightly larger */
    color: var(--text-highlight);
    text-shadow: 0 0 6px var(--text-highlight);
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 8px; display: flex; align-items: center;
}
h2 i { margin-right: 8px; } /* Icon spacing */

.control-group { margin-bottom: 18px; }
.control-group label { display: block; margin-bottom: 10px; font-weight: 400; color: var(--text-secondary); }
.control-group span#timeSpeedDisplay { font-weight: bold; color: var(--text-primary); margin-left: 8px; }

/* Buttons - Rely on Icons + Tooltips */
.controls-panel button {
    background-color: var(--button-bg); border: 1px solid var(--button-border); color: var(--text-primary);
    padding: 8px 10px; /* Adjust padding for icons */
    margin: 4px; /* Adjust spacing */
    border-radius: 5px; cursor: pointer; font-family: 'Exo 2', sans-serif; font-size: 1em; /* Make icons slightly larger */
    transition: all 0.2s ease; vertical-align: middle; width: 38px; /* Fixed width for consistency */ height: 38px; line-height: 1; /* Center icon vertically */
    display: inline-flex; align-items: center; justify-content: center;
}
.controls-panel button:hover {
    background-color: var(--button-hover-bg); color: #fff; box-shadow: 0 0 10px var(--panel-shadow);
}
.controls-panel button:active {
    background-color: var(--button-active-bg); transform: translateY(1px);
}
.controls-panel button.active {
    background-color: var(--button-active-bg); color: var(--button-active-color); font-weight: 600;
    /* box-shadow: 0 0 5px var(--button-active-glow), inset 0 0 3px var(--button-active-inset); */
    animation: subtlePulse 1.5s infinite ease-in-out; /* Pulsing glow for active state */
}
.controls-panel button.active:hover { background-color: rgba(50, 200, 255, 0.9); }
.controls-panel button i { margin-right: 0; /* No margin needed if only icon */ width: auto; } /* Reset icon styles if only icon */

.hint { font-size: 0.85em; color: var(--text-secondary); margin-top: 15px; font-style: italic; }
.hint i { margin-right: 5px; }

/* Info Panel Specifics */
.info-content { display: flex; flex-direction: column; gap: 15px; } /* Stack text and image */
.info-text p { margin: 6px 0; line-height: 1.5; font-size: 1em; }
.info-panel #infoName { font-weight: 600; font-size: 1.2em; color: var(--text-primary); margin-bottom: 10px; }
.info-panel #selectionHint { color: var(--text-secondary); display: block; }
.info-image-container { width: 100%; max-height: 180px; /* Limit image height */ overflow: hidden; border-radius: 5px; background-color: rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; }
#infoImage { display: none; /* Hidden by default */ max-width: 100%; height: auto; max-height: 180px; object-fit: contain; /* Changed from cover */ border-radius: 4px; }

/* Trail Styles */
/* Style will be applied directly via ctx.strokeStyle, ctx.lineWidth etc. */